<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use function MongoDB\select_server_for_aggregate_write_stage;

class StoreComment extends Model
{
    use HasFactory;
    protected $guarded=[];

    /**
     * 获取这条评论所属的博客。
     */
    public function post()
    {
        return $this->belongsTo(Store::class);
    }



    //查询所有评论
    static function AllComments(){
        return self::where('store_id',Store::class)->get();
    }

}
